package com.manshutingyu.system.api.feign;

import com.manshutingyu.common.core.dto.LoginUserDTO;
import com.manshutingyu.common.core.dto.R;
import com.manshutingyu.system.api.domain.SysUserDTO;
import com.manshutingyu.system.api.factory.RemoteSysUseFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Author：yinyuxia
 * @Date：2025/4/25 15:08
 */
@FeignClient(contextId = "manshutingyu-system",value = "manshutingyu-system",fallbackFactory = RemoteSysUseFallbackFactory.class )
public interface RemoteSysUserService {
    @GetMapping("/user/{id}")
    R<SysUserDTO> getById(@PathVariable("id") Long id);

    /**
     * 通过用户名查询用户信息
     * @param username
     * @return
     */
    @GetMapping("/user/info/{username}")
     R<LoginUserDTO> loadUserByUsername(@PathVariable("username") String username);

}
